package com.frxuexi.sign.repository

import com.frxuexi.lib_base.ApiResponse
import com.frxuexi.lib_base.BaseRepository
import com.frxuexi.lib_http.HttpType
import com.frxuexi.lib_http.NetWorkFactory
import com.frxuexi.sign.ApiService
import com.frxuexi.sign.entity.SignEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import javax.inject.Inject

@OptIn
class SignRepository @Inject constructor():BaseRepository() {
    val apiService by lazy{NetWorkFactory.factory(HttpType.NONE).create(ApiService::class.java)}

    fun getSignList(map: Map<String,Int>): Flow<ApiResponse<List<SignEntity>>> {
        return apiService.getSignList(mapToBody(map))
    }

    fun sign(map: Map<String,Any>): Flow<ApiResponse<List<SignEntity>>>{
        return apiService.sign(mapToBody(map))
    }
}